<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('添加会员余额')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="addAdvanceForm">
			<!-- 余额弹窗 -->
			<div class="form-group">
				<label for="advance_memberId" class="col-sm-3 control-label">会员id：</label>
				<div class="col-sm-8">
					<input type="text" class="form-control" id="advance_memberId" name="memberId" placeholder="请输入会员id">
				</div>
			</div>
			<div class="form-group">
				<label for="advance_newVal" class="col-sm-3 control-label">添加余额：</label>
				<div class="col-sm-8">
					<input type="text" class="form-control" id="advance_newVal" name="newVal" placeholder="添加的余额值，若小于0则表示减少用户余额">
				</div>
			</div>
			<div class="form-group">
				<label for="advance_reason" class="col-sm-3 control-label">操作说明：</label>
				<div class="col-sm-8">
					<input type="text" class="form-control" id="advance_reason" name="reason" placeholder="请输入操作原因，不超过50个字符">
				</div>
			</div>
		</form>
	</div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "member/member"

		$("#addAdvanceForm").validate({
			rules:{
				memberId:{
					required:true,
					number:true,
					min:1
				},
				newVal:{
					required:true,
					number:true
				},
				reason:{
					required:true,
					maxlength:50
				}
			},
			focusCleanup: true
		});

		function submitHandler() {
	        if ($.validate.form()) {
				$.operate.save(prefix + "/addMemberAdvance", $('#addAdvanceForm').serialize());
	        }
	    }
	</script>
</body>
</html>
